<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
   <!--添加复杂工具栏  -->
		<div id="huotb5" style="padding: 5px; height: auto">
				<div>
				<a href="javascript:void(0)" class="easyui-linkbutton" style="margin-left:85%"
						data-options="iconCls:'icon-save',plain:true" onclick="save()">保存</a>
				<a href="javascript:void(0)" class="easyui-linkbutton" 
						data-options="iconCls:'icon-clear',plain:true" onclick="clear()">清空</a>
				</div>
		</div>
			<div id="holidaybody" style="margin:2% 20%">
			<input class="easyui-textbox " type="hidden" style="display:none" id="ruleId"/><br>
				 <label>考勤规则名称:</label> 
				 <input  id="computId" class="easyui-combobox holidaytext"/><br>
				 <label style="margin:2% 0">上班打卡时间:</label> 
				 <input id="inbeginTime"class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input>
				 <label style="margin:2% 0">结束时间:</label> 
				 <input id="inendTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input></br>
				 <label>迟到打卡时间:</label> 
				 <input id="latebeginTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input>
				 <label >结束时间:</label> 
				 <input id="lateendTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input></br>
				 <label style="margin:2% 0">早退打卡时间:</label> 
				 <input id="earlybeginTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input>
				 <label>结束时间:</label> 
				 <input id="earlyendTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input></br>
				 <label style="margin:2% 0">下班打卡时间:</label> 
				 <input id="outbeginTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input>
				 <label>结束时间:</label> 
				 <input id="outendTime" class="easyui-timespinner holidaytext" data-options="min:'00:00:00',max:'24:00:00',showSeconds:true"></input></br>
				<label for="dname">备<sapn style="margin-left:9%"></sapn>注:</label>
				<textarea rows="10" cols="30" class=" holidaytext" id="remark" style="height:30px"></textarea>
			</div>
			<script type="text/javascript">
			function clear(){
				$('#ff').form('clear');
			}
		   $('#computId').combobox({
				url:'../rule/getComputeRules2',
				valueField:'computeId',
				textField:'computeName',
				panelHeight:'auto'
				});
			function save(){
				var	computId=$("#computId").val();
				var clockIn='上班';
				var	inbeginTime=$("#inbeginTime").timespinner('getValue');
				var	inendTime=$("#inendTime").timespinner('getValue');
				var clockLate='迟到';		
				var	latebeginTime=$("#latebeginTime").timespinner('getValue');
				var	lateendTime=$("#lateendTime").timespinner('getValue');
				var earlyClock='早退';
				var	earlybeginTime=$("#earlybeginTime").timespinner('getValue');
				var	earlyendTime=$("#earlyendTime").timespinner('getValue');
				var clockOut='下班';
				var	outbeginTime=$("#outbeginTime").timespinner('getValue');
				var	outendTime=$("#outendTime").timespinner('getValue');
				var	remark=$("#remark").val();
				var rules = [];
				var maker='huohuo';
				var rule = {
						computId : computId,
						clockIn:clockIn,
						inbeginTime : inbeginTime,
						inendTime : inendTime,
						clockLate:clockLate,
						latebeginTime : latebeginTime,
						lateendTime : lateendTime,
						earlyClock:earlyClock,
						earlybeginTime:earlybeginTime,
						earlyendTime:earlyendTime,
						clockOut:clockOut,
						outbeginTime:outbeginTime,
						outendTime:outendTime,
						remark:remark,
						maker:maker,
					};
				    rules.push(rule);
					var jsondata = JSON.stringify(rules);
					alert(jsondata);
				$.ajax({
					url : "../rule/addCheckRule",
					data : {"jsondata" : jsondata},
					success : function(e) {
						if (e == "ok") {
							alert("存储成功");
			               $('#huodg5').datagrid('load');
						}
					}
				});
			}
			</script>
</body>
</html>